﻿
<div class="main no-border no-padding">
        <table border=0 cellpadding=0 cellspacing=0 class="table table-bordered" id="tb_list">
            <thead>
                <thead><tr>
                    <td align="left">模板目录(点击选择)</td>
                </tr>
            </thead>
            <tr class="item list-template-item" id="item_{id}">
                <td align=left><a href="javascript:void(0)" class="btn btn-sm btn_select" name="{name}">{Name}</a></td>
            </tr>
        </table>
    <div class="tishi"><i class="fa fa-exclamation-circle"></i>模板放在/Templates目录下，每个文件夹表示一个模板!</div>
</div>
<script type="text/javascript">

    var objName = Request("objname");
    var $parentObj = parent.$(objName);
    if ($parentObj.length == 0) {
        alert("父级的objid对象未找到！")
    }

    //绑定数据
    function LoadData() {
        var params={url:"@Url.ActionUrl("TemplatesDirectoryList")",showFooter:false}
        $("#tb_list").ListBind(params);
    }
    LoadData();

    $(document).on("click", ".btn_select", function (event) {
        var $this = $(this);
        if ($this.attr("disabled")) { return;}
        var name = $this.attr("name");
        $parentObj.val(name);
        CloseDialog();
    });
</script>


